<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use Dingo\Api\Routing\Helpers;
use App\Http\Controllers\Controller as BaseController;

class Controller extends BaseController
{
    use Helpers;

    /**
     * @param $data array | Model
     * @param integer $code [<description>]
     * @param string $msg [<description>]
     * @return JsonResponse
     */
    protected function respondWithData($data, $code = 0, $msg = '')
    {
    	if($msg === ''){
    		$msg = code_msg($code);
    	}
        return response()->json(['code' => $code, 'msg' => $msg, 'data' => $data]);
    }
}
